
##
#Basic request of cloud front
class CFrequest(AWSrequest):
    def __init__(self:
        self.addSubResource('action')
    def authorize(self):
        pass
    def getStringToSign(self):
        timestamp=self.timestamp()
        self.setHeader('Date',timestamp)
        return timestamp
    def getSignature(self,sstr):
        pass
    def send(self):
        return super(self,CFrequest).send()
##
#
class distribution (AWSservice):
    def __init__(self,):
        pass
    def create(self):
        pass
    def update(self):
        pass
    def delet(self):
        pass
class CloudFront(AWSservice):
    def listDistributions(self):
        pass
##
#Configuration of distribution
class DistConfiguration (AWSConfiguration):
    def __init__(self,data=None):
        if data:
            self.data=DataNode(data)
        else:
            self.data=DataNode('DistributionConfig',namespace='http://cloudfront.amazonaws.com/doc/2012-05-05/')
            #self.data.append('CallerReference')
    def descripton(self,descr=None):
        if not self.data.hasChild('CallerReference')
            self.data.append('CallerReference',descr)
        if descr:
            self.data.CallerReference.set(descr)
        else:
            return self.data.CallerReference.value()
    def addAlias(self,cname):
        if not self.data.hasChild('Aliases')
            self.data.append('Aliases')
            self.data.Aliases.append('Quantity',1)
            self.data.Aliases.append('Items')
            self.data.Aliases.Items.append('CNAME',cname)
        else:
            quantity=int(self.data.Aliases.Quantity.value())+1
            self.data.Aliases.Quantity.set(quantity)
            self.data.Aliases.Items.append('CNAME',cname)
    def root(self,index=None):
        if not self.data.hasChild('DefaultRootObject'):
            self.data.append('DefaultRootObject',index)
        else:
            if index:
                self.data.DefaultRootObject.set(index)
            else:
                return self.data.DefaultRootObject.value()
    def serve(self,origin):
        pass
